<template>
  <div class="box">
    <h1>Child</h1>
    <input
      type="text"
      :value="value"
      @input="$emit('input', $event.target.value)"
    />

    <button @click="$emit('input', value + 1)">修改value</button>
  </div>
</template>

<script>
export default {
  name: "Child",
  props: ["value"],
};
</script>

<style scoped>
.box {
  background: yellowgreen;
}
</style>
